﻿using System;
using System.Xml.Serialization;

namespace UTable.Core.Configuration
{
    [Serializable]
    public class ProviderConfiguration
    {
        /// <summary>
        /// Instance of the provider
        /// Actual Type: IInputProvider
        /// </summary>
        private Object _instance;

        #region Properties

        [XmlIgnore]
        public Object Instance { get { return _instance; } }

        /// <summary>
        /// Class Configuration of instance
        /// </summary>
        public ClassConfiguration Class { get; set; }

        #endregion

        #region Initialization

        /// <summary>
        /// Constructor without parameters for serialization
        /// </summary>
        public ProviderConfiguration() { }

        public void CreateInstance()
        {
            _instance = Class.CreateInstance();
        }

        #endregion
    }
}
